package com.appwoo.txtws.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import java.util.List;

public class SimpleListAdapter<T> extends BaseAdapter
{
  private ListViewCreator<T> creator;
  private List<T> entries;
  private boolean isReverse;

  public SimpleListAdapter(List<T> paramList, ListViewCreator<T> paramListViewCreator)
  {
    this(paramList, paramListViewCreator, false);
  }

  public SimpleListAdapter(List<T> paramList, ListViewCreator<T> paramListViewCreator, boolean paramBoolean)
  {
    this.entries = paramList;
    this.creator = paramListViewCreator;
    this.isReverse = paramBoolean;
  }

  private int getIndex(int paramInt)
  {
    if (this.isReverse)
      paramInt = -1 + this.entries.size() - paramInt;
    return paramInt;
  }

  public int getCount()
  {
    return this.entries.size();
  }

  public Object getItem(int paramInt)
  {
    return this.entries.get(getIndex(paramInt));
  }

  public long getItemId(int paramInt)
  {
    return getIndex(paramInt);
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    return this.creator.createView(this.entries.get(getIndex(paramInt)), paramView, paramInt);
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.adapter.SimpleListAdapter
 * JD-Core Version:    0.6.2
 */